import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import legacy from '@vitejs/plugin-legacy';
import Components from 'unplugin-vue-components/vite';
import { VantResolver } from "@vant/auto-import-resolver";


// https://vitejs.dev/config/
export default {
  server: {
    port: 4000, //指定端口号
    host: '0.0.0.0', //可局域网IP访问
    open: true,
  },
  plugins: [
    vue(),
    Components({
      resolvers: [VantResolver()],
    }),
    legacy({
      targets: ['Chrome 69'],//兼容配置
      modernPolyfills: true,
    }),
  ],
  base: '',//路径
  build: {
    rollupOptions: {
      input: {
        main: resolve(__dirname, 'index.html'),
        // nested: resolve(__dirname, 'nested/index.html')
      }
    }
  }
}
